package com.duying.gh.manager;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.StringUtils;

import com.busi.framework.base.PageSupport;
import com.duying.gh.GhCommonManager;
import com.duying.gh.action.form.PayItemForm;

public class PayItemManager   extends GhCommonManager{
	
	public PageSupport getPage(PayItemForm piForm , Integer pageNo){
		String hql = "from PayItem pi where 1=1 ";
		Map params = new HashMap();
		if(piForm != null){
			String dhcard_no = piForm.getDhcard_no();
			if(StringUtils.isNotBlank(dhcard_no)){
				hql += " and pi.dhcard_no like:dhcard_no ";
				params.put("dhcard_no", "%"+dhcard_no.trim()+"%");
			}
			String pay_people = piForm.getPay_people();
			if(StringUtils.isNotBlank(pay_people)){
				hql += " and pi.pay_people like:pay_people ";
				params.put("pay_people", "%"+pay_people.trim()+"%");
			}
		}
		
		hql += " order by pi.pay_time desc";
		PageSupport page = this.baseDao.findPageByHql(hql, pageNo , params);
		return page;
	}

}
